package com.ruoyi.base.service.impl;

import com.ruoyi.base.domain.BTopic;
import com.ruoyi.base.mapper.BTopicMapper;
import com.ruoyi.base.service.IBTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题目Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-24
 */
@Service
public class BTopicServiceImpl implements IBTopicService {
    @Autowired
    private BTopicMapper bTopicMapper;

    /**
     * 查询题目
     *
     * @param topicId 题目主键
     * @return 题目
     */
    @Override
    public BTopic selectBTopicByTopicId(Long topicId) {
        return bTopicMapper.selectBTopicByTopicId(topicId);
    }

    /**
     * 查询题目列表
     *
     * @param bTopic 题目
     * @return 题目
     */
    @Override
    public List<BTopic> selectBTopicList(BTopic bTopic) {
        return bTopicMapper.selectBTopicList(bTopic);
    }

    /**
     * 新增题目
     *
     * @param bTopic 题目
     * @return 结果
     */
    @Override
    public int insertBTopic(BTopic bTopic) {
        return bTopicMapper.insertBTopic(bTopic);
    }

    /**
     * 修改题目
     *
     * @param bTopic 题目
     * @return 结果
     */
    @Override
    public int updateBTopic(BTopic bTopic) {
        return bTopicMapper.updateBTopic(bTopic);
    }

    /**
     * 批量删除题目
     *
     * @param topicIds 需要删除的题目主键
     * @return 结果
     */
    @Override
    public int deleteBTopicByTopicIds(Long[] topicIds) {
        return bTopicMapper.deleteBTopicByTopicIds(topicIds);
    }

    /**
     * 删除题目信息
     *
     * @param topicId 题目主键
     * @return 结果
     */
    @Override
    public int deleteBTopicByTopicId(Long topicId) {
        return bTopicMapper.deleteBTopicByTopicId(topicId);
    }
}
